package com.amose.factory;

import com.amose.config.Configuration;
import com.amose.config.MapperStatement;

import java.sql.SQLException;
import java.util.List;

/**
 * @author yangpeng
 * @time 2020/2/22
 * @since 1.0.0
 */
public interface Executor {

    /**
     * （根据返回类型判断）查询列表
     * @param <T>
     * @return
     */
    public <T> List<T> queryList(Configuration configuration, MapperStatement mapperStatement,Object... params) throws SQLException, ClassNotFoundException, NoSuchFieldException, IllegalAccessException, InstantiationException;

    /**
     * （根据返回类型判断）查询单个数据
     * @param <T>
     * @return
     */
    public <T> T queryOne(Configuration configuration, MapperStatement mapperStatement,Object... params) throws ClassNotFoundException, SQLException, InstantiationException, IllegalAccessException, NoSuchFieldException;

    /**
     * 更新
     * @return
     */
    public int update(Configuration configuration, MapperStatement mapperStatement,Object... params) throws SQLException, ClassNotFoundException, NoSuchFieldException, IllegalAccessException;

}
